package OOP;

public class ObjectDemo {
    public static void main(String[] args) {
        // static attribute
        ClassDemo c = new ClassDemo();
        System.out.println("ClassDemo.useful = " + ClassDemo.useful + ", c.useful = " + c.useful);
        ClassDemo.People p = c.new People(180.5, 20, 1);
        p.showInfo();
        // reference passing
        ClassDemo.People p2 = p;
        System.out.println("p2 == p: " + (p2 == p));
        System.out.println("p.sex = " + p.sex);
        int sex = 0;
        System.out.println("set p2.sex = " + sex);
        p2.sex = sex;
        System.out.println("p.sex = " + p.sex);
    }
}
